package org.testmyapp.entities;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.testmyapp.persistence.BusinessObjectMarker;

@Entity
@IdClass(WaitingTimePk.class)
public class WaitingTime extends AbsProcessRelatedObject implements
		BusinessObjectMarker {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4029009051857148970L;

	public static String tableName ="WaitingTime";
	
	@Id
	@ManyToOne
	@JoinTable(name = "tariffInstance_fk", joinColumns = {
			@JoinColumn(name = "ti_ip_fk", referencedColumnName = "ip_fk"),
			@JoinColumn(name = "ti_tarif_fk", referencedColumnName = "tarif_fk") })
	private TariffInstance tariffInstance;
	@Id
	private int waitingTimeNr;
	@Temporal(value = TemporalType.DATE)
	private Date first;
	@Temporal(value = TemporalType.DATE)
	private Date last;
	private boolean valid;
	
	public TariffInstance getTariffInstance() {
		return tariffInstance;
	}
	public void setTariffInstance(TariffInstance tariffInstance) {
		this.tariffInstance = tariffInstance;
	}
	public int getWaitingTimeNr() {
		return waitingTimeNr;
	}
	public void setWaitingTimeNr(int waitingTimeNr) {
		this.waitingTimeNr = waitingTimeNr;
	}
	public boolean isValid() {
		return valid;
	}
	public void setValid(boolean valid) {
		this.valid = valid;
	}
	public Date getFirst() {
		return first;
	}
	public void setFirst(Date first) {
		this.first = first;
	}
	public Date getLast() {
		return last;
	}
	public void setLast(Date last) {
		this.last = last;
	}
	
}
